kirby = {
		x: 0,
		y: 0,
		sx: 0,
		p: 0,
		f: 0,

		/*
		l: '',
		w: '',
		s: '',
		img: '',
		 */

		stand:{
			r: 0,
			l: 3,
			w: 62,
			s: 6,
			img: new Image()
		},
		walk:{
			l: 9,
			w: 62,
			s: 4,
			img: new Image()
		},
		run:{
			l: 7,
			w: 62,
			s: 3,
			img: new Image()
		},
		jump:{
			l:1,
		}
};



kirby.run.img.src = "kirbyRun.png";
kirby.stand.img.src = "kirbyStand.png";
kirby.walk.img.src = "kirbyWalk.png";

var anim = kirby.stand;

function Render(buf, a) {
	ctx.clearRect(0,0,canvas.width, canvas.height);
	console.log(a);
	//if (key.left == true) {
		//buf.translate(a.w, 0);
		//buf.scale(-1,1);
	//}

	if (a == kirby.run){
		kirby.x += 4;
	} else if (a == kirby.walk) {
		kirby.x += 2;
	}

	if (kirby.f == a.s && kirby.p == a.l) {
		kirby.f = 0;
		kirby.p = 0;
	} else if ( kirby.f == a.s) {
		kirby.f = 0;
		kirby.p++;
	}

	kirby.sx = kirby.p * a.w;

	buf.drawImage(a.img, kirby.sx, 0, a.w, a.img.height, kirby.x, kirby.y, a.w, a.img.height);

	kirby.f++;
}